class window.caption_image_vm
  constructor: (@parent) ->    
    @selectedImage = ko.observable @parent.current_game().image()    
 
    @caption = ko.observable ''
                  
  Refresh: () =>
    @caption ''
    @selectedImage @parent.current_game().image()
    
  Submit_Caption: () =>
    user_name = @parent.options.user_name()
    @parent.current_game().captions().push new caption_model(user_name, @caption())
    $('#captionDialog').popup("open")
    
  Navigate: () =>
    $('#captionDialog').popup("close")
    @parent.Navigate Templates.HOME
    
    